//
//  PKNewCommentBar.swift
//  Panku
//
//  Created by mac on 2017/5/28.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKNewCommentBar: PKBaseView {
    
    //MARK: - UI
    lazy var commentTextField = UITextField()
    lazy var emojiButton = PKBaseButton.createButton()
    lazy var submitButton = PKBaseButton.createButton()
    
    override func setupView() {
        self.addSubview(commentTextField)
        self.addSubview(emojiButton)
        self.addSubview(submitButton)
        
        self.backgroundColor = UIColor.white
        
        commentTextField.placeholder = "写评论"
        commentTextField.leftView = UIImageView(image: R.image.home_new_comment())
        
        submitButton.setTitle("发送", for: .normal)
        submitButton.addBlock(for: .touchUpInside) { (_) in
            //发送评论
        }
        
        commentTextField.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.snp.centerY)
            make.left.equalTo(self.snp.left).offset(12)
        }
        
        emojiButton.snp.makeConstraints { (make) in
            make.centerY.equalTo(self.snp.centerY)
            make.right.equalTo(submitButton.snp.left).offset(11)
        }
        
        submitButton.snp.makeConstraints { (make) in
            make.right.equalTo(self.snp.right).offset(12)
            make.centerY.equalTo(self.snp.centerY)
        }
        
    }

}
